<?php if(!defined('A')) exit;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站内容管理系统</title>
<?php
loadcss(array('reset','shell'));
loadcss(array('colorbox'),P_CSS);
loadjs('jquery',P_JS);
loadjs(array('tab','util','table'));
loadjs(array('jquery.colorbox'),P_JS);
?>
<script type="text/javascript">
$(document).ready(function(e) {
var smallNowTab;
var pt = new Tabs();
pt.classpre="smalltab_";
pt.container = "smalltab_container";
pt.createTab("t1","分类列表","",true,"n");
pt.init = function(){
	smallNowTab = pt.nowTab;
};
pt.onclick = function(){
	smallNowTab = pt.nowTab;
};		
pt.initTab();
pt.clickNowTab();    
$(".example1").colorbox({width:"800px", height:"600px", iframe:true, opacity:0.3});
$(".example2").colorbox({width:"800px", height:"400px", iframe:true, opacity:0.3});
$(".example3").colorbox({width:"100%", height:"100%", iframe:true, opacity:0.3});
});
</script>
<style>
body{margin:10px;}
</style>
</head>
<body>
<table class="settop">
<tr>
<td class="settop_left">
&nbsp;&nbsp;
</td>
<td>
<div id="smalltab_container"></div>
</td>
</tr>
</table>
<div class="smalltab_line"></div>
<div id="t1">
<br />
<br />
<table width="90%" border="0" cellspacing="0" cellpadding="0" class="mytable">
  <tr>
    <td colspan="2"><strong>顶级分类</strong></td>
  </tr>
  
<?php 
foreach ($category_arr as $key => $value) {
    $n=substr_count($value['path'], ',');
    $background=$category_service->get_background($n);
	$w=$category_service->get_sub_count($value['id']);
?>
<tr>
    <td>
  <p style="background:<?php echo $background;?>;height:30px;line-height:30px;border:1px solid #ccc;">
  <?php echo str_repeat('&nbsp;',$n*4)?>┖─&nbsp;<strong class="cate_list"><?php echo $value['name'] ?></strong>
  </p>
    </td>
<td align="center">
  <?php if($value['type']==1){?>
  <a href="<?php echo url('category','add','mid='.$mid.'&selected_c='.$value['id']);?>" class="example1">添加子类</a> || 
  <?php
}else{
?>
  
  <?php
}
?>
  <a href="<?php echo url('category','mod','mid='.$mid.'&id='.$value['id']);?>" class="example1">编辑</a> || 
  <a href="<?php echo url('category','del','mid='.$mid.'&id='.$value['id']);?>" onclick="return confirm('确定要删除么？有下级分类或有文章的分类无法删除！');">删除</a> 
</td>
</tr>
<?php
}
?>
</table>

</div>
</body>
</html>